(module binary
  "\00\61\73\6d\01\00\00\00\01\9e\80\80\80\00\07\60"
  "\00\00\60\01\7f\00\60\01\7d\00\60\00\01\7f\60\00"
  "\01\7d\60\01\7f\01\7f\60\01\7e\01\7e\03\88\80\80"
  "\80\00\07\00\01\02\03\04\05\06\04\84\80\80\80\00"
  "\01\70\00\0a\05\83\80\80\80\00\01\00\02\06\8e\80"
  "\80\80\00\02\7f\00\41\37\0b\7d\00\43\00\00\30\42"
  "\0b\07\8e\81\80\80\00\0b\04\66\75\6e\63\00\00\08"
  "\66\75\6e\63\2d\69\33\32\00\01\08\66\75\6e\63\2d"
  "\66\33\32\00\02\09\66\75\6e\63\2d\3e\69\33\32\00"
  "\03\09\66\75\6e\63\2d\3e\66\33\32\00\04\0d\66\75"
  "\6e\63\2d\69\33\32\2d\3e\69\33\32\00\05\0d\66\75"
  "\6e\63\2d\69\36\34\2d\3e\69\36\34\00\06\0a\67\6c"
  "\6f\62\61\6c\2d\69\33\32\03\00\0a\67\6c\6f\62\61"
  "\6c\2d\66\33\32\03\01\0c\74\61\62\6c\65\2d\31\30"
  "\2d\69\6e\66\01\00\0c\6d\65\6d\6f\72\79\2d\32\2d"
  "\69\6e\66\02\00\0a\bd\80\80\80\00\07\82\80\80\80"
  "\00\00\0b\82\80\80\80\00\00\0b\82\80\80\80\00\00"
  "\0b\84\80\80\80\00\00\41\16\0b\87\80\80\80\00\00"
  "\43\00\00\30\41\0b\84\80\80\80\00\00\20\00\0b\84"
  "\80\80\80\00\00\20\00\0b"
)
(register "test")
(module binary
  "\00\61\73\6d\01\00\00\00\01\a4\80\80\80\00\08\60"
  "\01\7f\00\60\01\7e\00\60\01\7d\00\60\01\7c\00\60"
  "\01\7f\00\60\02\7f\7d\00\60\02\7c\7c\00\60\01\7e"
  "\01\7e\02\d9\82\80\80\00\10\08\73\70\65\63\74\65"
  "\73\74\09\70\72\69\6e\74\5f\69\33\32\00\00\08\73"
  "\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69\33"
  "\32\00\00\08\73\70\65\63\74\65\73\74\09\70\72\69"
  "\6e\74\5f\66\33\32\00\02\08\73\70\65\63\74\65\73"
  "\74\09\70\72\69\6e\74\5f\66\36\34\00\03\08\73\70"
  "\65\63\74\65\73\74\0d\70\72\69\6e\74\5f\69\33\32"
  "\5f\66\33\32\00\05\08\73\70\65\63\74\65\73\74\0d"
  "\70\72\69\6e\74\5f\66\36\34\5f\66\36\34\00\06\08"
  "\73\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69"
  "\33\32\00\00\08\73\70\65\63\74\65\73\74\09\70\72"
  "\69\6e\74\5f\66\36\34\00\03\04\74\65\73\74\0d\66"
  "\75\6e\63\2d\69\36\34\2d\3e\69\36\34\00\07\08\73"
  "\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69\33"
  "\32\00\00\08\73\70\65\63\74\65\73\74\09\70\72\69"
  "\6e\74\5f\69\33\32\00\00\08\73\70\65\63\74\65\73"
  "\74\09\70\72\69\6e\74\5f\69\33\32\00\00\08\73\70"
  "\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69\33\32"
  "\00\00\08\73\70\65\63\74\65\73\74\09\70\72\69\6e"
  "\74\5f\69\33\32\00\00\08\73\70\65\63\74\65\73\74"
  "\09\70\72\69\6e\74\5f\69\33\32\00\04\08\73\70\65"
  "\63\74\65\73\74\09\70\72\69\6e\74\5f\69\33\32\00"
  "\04\03\83\80\80\80\00\02\00\01\04\85\80\80\80\00"
  "\01\70\01\02\02\07\b3\80\80\80\00\08\02\70\31\00"
  "\09\02\70\32\00\0a\02\70\33\00\0b\02\70\34\00\0b"
  "\02\70\35\00\0c\02\70\36\00\0d\07\70\72\69\6e\74"
  "\33\32\00\10\07\70\72\69\6e\74\36\34\00\11\09\88"
  "\80\80\80\00\01\00\41\00\0b\02\01\03\0a\e8\80\80"
  "\80\00\02\ac\80\80\80\00\01\01\7d\20\00\b2\21\01"
  "\20\00\10\00\20\00\41\01\6a\43\00\00\28\42\10\04"
  "\20\00\10\01\20\00\10\06\20\01\10\02\20\00\41\00"
  "\11\00\00\0b\b1\80\80\80\00\01\01\7c\20\00\10\08"
  "\b9\21\01\20\01\44\00\00\00\00\00\00\f0\3f\a0\44"
  "\00\00\00\00\00\80\4a\40\10\05\20\01\10\03\20\01"
  "\10\07\20\01\41\01\11\03\00\0b"
)
(assert_return (invoke "print32" (i32.const 13)))
(assert_return (invoke "print64" (i64.const 24)))
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7f\02\8d\80\80\80\00\01\04\74\65\73\74\04"
    "\66\75\6e\63\00\01"
  )
  "unknown type"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
  "\00\00\02\8d\80\80\80\00\01\04\74\65\73\74\04\66"
  "\75\6e\63\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
  "\01\7f\00\02\91\80\80\80\00\01\04\74\65\73\74\08"
  "\66\75\6e\63\2d\69\33\32\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
  "\01\7d\00\02\91\80\80\80\00\01\04\74\65\73\74\08"
  "\66\75\6e\63\2d\66\33\32\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
  "\00\01\7f\02\92\80\80\80\00\01\04\74\65\73\74\09"
  "\66\75\6e\63\2d\3e\69\33\32\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
  "\00\01\7d\02\92\80\80\80\00\01\04\74\65\73\74\09"
  "\66\75\6e\63\2d\3e\66\33\32\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
  "\01\7f\01\7f\02\96\80\80\80\00\01\04\74\65\73\74"
  "\0d\66\75\6e\63\2d\69\33\32\2d\3e\69\33\32\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
  "\01\7e\01\7e\02\96\80\80\80\00\01\04\74\65\73\74"
  "\0d\66\75\6e\63\2d\69\36\34\2d\3e\69\36\34\00\00"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\90\80\80\80\00\01\04\74\65\73\74\07\75"
    "\6e\6b\6e\6f\77\6e\00\00"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\94\80\80\80\00\01\08\73\70\65\63\74\65"
    "\73\74\07\75\6e\6b\6e\6f\77\6e\00\00"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\01\7f\00\02\8d\80\80\80\00\01\04\74\65\73\74\04"
    "\66\75\6e\63\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7f\02\8d\80\80\80\00\01\04\74\65\73\74\04"
    "\66\75\6e\63\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
    "\01\7f\01\7f\02\8d\80\80\80\00\01\04\74\65\73\74"
    "\04\66\75\6e\63\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\91\80\80\80\00\01\04\74\65\73\74\08\66"
    "\75\6e\63\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7f\02\91\80\80\80\00\01\04\74\65\73\74\08"
    "\66\75\6e\63\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\01\7d\00\02\91\80\80\80\00\01\04\74\65\73\74\08"
    "\66\75\6e\63\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\01\7e\00\02\91\80\80\80\00\01\04\74\65\73\74\08"
    "\66\75\6e\63\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
    "\01\7f\01\7f\02\91\80\80\80\00\01\04\74\65\73\74"
    "\08\66\75\6e\63\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\92\80\80\80\00\01\04\74\65\73\74\09\66"
    "\75\6e\63\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\01\7f\00\02\92\80\80\80\00\01\04\74\65\73\74\09"
    "\66\75\6e\63\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7d\02\92\80\80\80\00\01\04\74\65\73\74\09"
    "\66\75\6e\63\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7e\02\92\80\80\80\00\01\04\74\65\73\74\09"
    "\66\75\6e\63\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
    "\01\7f\01\7f\02\92\80\80\80\00\01\04\74\65\73\74"
    "\09\66\75\6e\63\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\96\80\80\80\00\01\04\74\65\73\74\0d\66"
    "\75\6e\63\2d\69\33\32\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\01\7f\00\02\96\80\80\80\00\01\04\74\65\73\74\0d"
    "\66\75\6e\63\2d\69\33\32\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7f\02\96\80\80\80\00\01\04\74\65\73\74\0d"
    "\66\75\6e\63\2d\69\33\32\2d\3e\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
    "\00\01\7f\02\93\80\80\80\00\01\04\74\65\73\74\0a"
    "\67\6c\6f\62\61\6c\2d\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\95\80\80\80\00\01\04\74\65\73\74\0c\74"
    "\61\62\6c\65\2d\31\30\2d\69\6e\66\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\95\80\80\80\00\01\04\74\65\73\74\0c\6d"
    "\65\6d\6f\72\79\2d\32\2d\69\6e\66\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\97\80\80\80\00\01\08\73\70\65\63\74\65"
    "\73\74\0a\67\6c\6f\62\61\6c\5f\69\33\32\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\92\80\80\80\00\01\08\73\70\65\63\74\65"
    "\73\74\05\74\61\62\6c\65\00\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60"
    "\00\00\02\93\80\80\80\00\01\08\73\70\65\63\74\65"
    "\73\74\06\6d\65\6d\6f\72\79\00\00"
  )
  "incompatible import type"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60"
  "\00\01\7f\02\8b\81\80\80\00\06\08\73\70\65\63\74"
  "\65\73\74\0a\67\6c\6f\62\61\6c\5f\69\33\32\03\7f"
  "\00\08\73\70\65\63\74\65\73\74\0a\67\6c\6f\62\61"
  "\6c\5f\69\33\32\03\7f\00\08\73\70\65\63\74\65\73"
  "\74\0a\67\6c\6f\62\61\6c\5f\69\33\32\03\7f\00\08"
  "\73\70\65\63\74\65\73\74\0a\67\6c\6f\62\61\6c\5f"
  "\69\33\32\03\7f\00\08\73\70\65\63\74\65\73\74\0a"
  "\67\6c\6f\62\61\6c\5f\66\33\32\03\7d\00\08\73\70"
  "\65\63\74\65\73\74\0a\67\6c\6f\62\61\6c\5f\66\36"
  "\34\03\7c\00\03\85\80\80\80\00\04\00\00\00\00\07"
  "\a1\80\80\80\00\04\05\67\65\74\2d\30\00\00\05\67"
  "\65\74\2d\31\00\01\05\67\65\74\2d\78\00\02\05\67"
  "\65\74\2d\79\00\03\0a\a5\80\80\80\00\04\84\80\80"
  "\80\00\00\23\00\0b\84\80\80\80\00\00\23\01\0b\84"
  "\80\80\80\00\00\23\02\0b\84\80\80\80\00\00\23\03"
  "\0b"
)
(assert_return (invoke "get-0") (i32.const 666))
(assert_return (invoke "get-1") (i32.const 666))
(assert_return (invoke "get-x") (i32.const 666))
(assert_return (invoke "get-y") (i32.const 666))
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\04"
  "\74\65\73\74\0a\67\6c\6f\62\61\6c\2d\69\33\32\03"
  "\7f\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\04"
  "\74\65\73\74\0a\67\6c\6f\62\61\6c\2d\66\33\32\03"
  "\7d\00"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\91\80\80\80\00\01\04"
    "\74\65\73\74\07\75\6e\6b\6e\6f\77\6e\03\7f\00"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\07\75\6e\6b\6e\6f\77\6e"
    "\03\7f\00"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\8e\80\80\80\00\01\04"
    "\74\65\73\74\04\66\75\6e\63\03\7f\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
    "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
    "\66\03\7f\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
    "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
    "\66\03\7f\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69"
    "\33\32\03\7f\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\93\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\03\7f"
    "\00"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\03"
    "\7f\00"
  )
  "incompatible import type"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\02\60"
  "\00\01\7f\60\01\7f\01\7f\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\0a\14\03\84\80\80\80\00\03\01\00\00\07\88\80"
  "\80\80\00\01\04\63\61\6c\6c\00\00\09\88\80\80\80"
  "\00\01\00\41\01\0b\02\01\02\0a\9f\80\80\80\00\03"
  "\87\80\80\80\00\00\20\00\11\00\00\0b\84\80\80\80"
  "\00\00\41\0b\0b\84\80\80\80\00\00\41\16\0b"
)
(assert_trap (invoke "call" (i32.const 0)) "uninitialized element")
(assert_return (invoke "call" (i32.const 1)) (i32.const 11))
(assert_return (invoke "call" (i32.const 2)) (i32.const 22))
(assert_trap (invoke "call" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "call" (i32.const 100)) "undefined element")
(module binary
  "\00\61\73\6d\01\00\00\00\01\8a\80\80\80\00\02\60"
  "\00\01\7f\60\01\7f\01\7f\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\0a\14\03\84\80\80\80\00\03\01\00\00\07\88\80"
  "\80\80\00\01\04\63\61\6c\6c\00\00\09\88\80\80\80"
  "\00\01\00\41\01\0b\02\01\02\0a\9f\80\80\80\00\03"
  "\87\80\80\80\00\00\20\00\11\00\00\0b\84\80\80\80"
  "\00\00\41\0b\0b\84\80\80\80\00\00\41\16\0b"
)
(assert_trap (invoke "call" (i32.const 0)) "uninitialized element")
(assert_return (invoke "call" (i32.const 1)) (i32.const 11))
(assert_return (invoke "call" (i32.const 2)) (i32.const 22))
(assert_trap (invoke "call" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "call" (i32.const 100)) "undefined element")
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\02\8d\80\80\80\00\02\00"
    "\00\01\70\00\0a\00\00\01\70\00\0a"
  )
  "multiple tables"
)
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\02\87\80\80\80\00\01\00"
    "\00\01\70\00\0a\04\84\80\80\80\00\01\70\00\0a"
  )
  "multiple tables"
)
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\04\87\80\80\80\00\02\70"
    "\00\0a\70\00\0a"
  )
  "multiple tables"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
  "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
  "\66\01\70\00\0a"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
  "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
  "\66\01\70\00\05"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
  "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
  "\66\01\70\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\00\0a"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\00\05"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\0a\14"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\05\14"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\00\14"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\0a\19"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
  "\01\05\19"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\92\80\80\80\00\01\04"
    "\74\65\73\74\07\75\6e\6b\6e\6f\77\6e\01\70\00\0a"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\07\75\6e\6b\6e\6f\77\6e"
    "\01\70\00\0a"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
    "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
    "\66\01\70\00\0c"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\98\80\80\80\00\01\04"
    "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
    "\66\01\70\01\0a\14"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
    "\00\0c"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\01\70"
    "\01\0a\0f"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\8f\80\80\80\00\01\04"
    "\74\65\73\74\04\66\75\6e\63\01\70\00\0a"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\04"
    "\74\65\73\74\0a\67\6c\6f\62\61\6c\2d\69\33\32\01"
    "\70\00\0a"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
    "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
    "\66\01\70\00\0a"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\98\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69"
    "\33\32\01\70\00\0a"
  )
  "incompatible import type"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
  "\01\7f\01\7f\02\95\80\80\80\00\01\08\73\70\65\63"
  "\74\65\73\74\06\6d\65\6d\6f\72\79\02\01\01\02\03"
  "\82\80\80\80\00\01\00\07\88\80\80\80\00\01\04\6c"
  "\6f\61\64\00\00\0a\8d\80\80\80\00\01\87\80\80\80"
  "\00\00\20\00\28\02\00\0b\0b\87\80\80\80\00\01\00"
  "\41\0a\0b\01\10"
)
(assert_return (invoke "load" (i32.const 0)) (i32.const 0))
(assert_return (invoke "load" (i32.const 10)) (i32.const 16))
(assert_return (invoke "load" (i32.const 8)) (i32.const 1048576))
(assert_trap (invoke "load" (i32.const 1000000)) "out of bounds memory access")
(module binary
  "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
  "\01\7f\01\7f\02\95\80\80\80\00\01\08\73\70\65\63"
  "\74\65\73\74\06\6d\65\6d\6f\72\79\02\01\01\02\03"
  "\82\80\80\80\00\01\00\07\88\80\80\80\00\01\04\6c"
  "\6f\61\64\00\00\0a\8d\80\80\80\00\01\87\80\80\80"
  "\00\00\20\00\28\02\00\0b\0b\87\80\80\80\00\01\00"
  "\41\0a\0b\01\10"
)
(assert_return (invoke "load" (i32.const 0)) (i32.const 0))
(assert_return (invoke "load" (i32.const 10)) (i32.const 16))
(assert_return (invoke "load" (i32.const 8)) (i32.const 1048576))
(assert_trap (invoke "load" (i32.const 1000000)) "out of bounds memory access")
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\02\8b\80\80\80\00\02\00"
    "\00\02\00\01\00\00\02\00\01"
  )
  "multiple memories"
)
(assert_invalid
  (module binary
    "\00\61\73\6d\01\00\00\00\02\86\80\80\80\00\01\00"
    "\00\02\00\01\05\83\80\80\80\00\01\00\00"
  )
  "multiple memories"
)
(assert_invalid
  (module binary "\00\61\73\6d\01\00\00\00\05\85\80\80\80\00\02\00" "\00\00\00")
  "multiple memories"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
  "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
  "\66\02\00\02"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
  "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
  "\66\02\00\01"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
  "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
  "\66\02\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\00\01"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\00\00"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\01\01\02"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\01\00\02"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\01\01\03"
)
(module binary
  "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
  "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
  "\01\00\03"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\91\80\80\80\00\01\04"
    "\74\65\73\74\07\75\6e\6b\6e\6f\77\6e\02\00\01"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\07\75\6e\6b\6e\6f\77\6e"
    "\02\00\01"
  )
  "unknown import"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
    "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
    "\66\02\00\03"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\04"
    "\74\65\73\74\0c\6d\65\6d\6f\72\79\2d\32\2d\69\6e"
    "\66\02\01\02\03"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
    "\00\02"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
    "\01\01\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\92\80\80\80\00\01\04"
    "\74\65\73\74\08\66\75\6e\63\2d\69\33\32\02\00\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\04"
    "\74\65\73\74\0a\67\6c\6f\62\61\6c\2d\69\33\32\02"
    "\00\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\96\80\80\80\00\01\04"
    "\74\65\73\74\0c\74\61\62\6c\65\2d\31\30\2d\69\6e"
    "\66\02\00\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\97\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\09\70\72\69\6e\74\5f\69"
    "\33\32\02\00\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\98\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\0a\67\6c\6f\62\61\6c\5f"
    "\69\33\32\02\00\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\93\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\05\74\61\62\6c\65\02\00"
    "\01"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\94\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
    "\00\02"
  )
  "incompatible import type"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\02\95\80\80\80\00\01\08"
    "\73\70\65\63\74\65\73\74\06\6d\65\6d\6f\72\79\02"
    "\01\01\01"
  )
  "incompatible import type"
)
(module binary
  "\00\61\73\6d\01\00\00\00\01\86\80\80\80\00\01\60"
  "\01\7f\01\7f\02\95\80\80\80\00\01\08\73\70\65\63"
  "\74\65\73\74\06\6d\65\6d\6f\72\79\02\01\00\03\03"
  "\82\80\80\80\00\01\00\07\88\80\80\80\00\01\04\67"
  "\72\6f\77\00\00\0a\8c\80\80\80\00\01\86\80\80\80"
  "\00\00\20\00\40\00\0b"
)
(assert_return (invoke "grow" (i32.const 0)) (i32.const 1))
(assert_return (invoke "grow" (i32.const 1)) (i32.const 1))
(assert_return (invoke "grow" (i32.const 0)) (i32.const 2))
(assert_return (invoke "grow" (i32.const 1)) (i32.const -1))
(assert_return (invoke "grow" (i32.const 0)) (i32.const 2))
(assert_malformed
  (module quote "(func) (import \"\" \"\" (func))")
  "import after function"
)
(assert_malformed
  (module quote "(func) (import \"\" \"\" (global i64))")
  "import after function"
)
(assert_malformed
  (module quote "(func) (import \"\" \"\" (table 0 anyfunc))")
  "import after function"
)
(assert_malformed
  (module quote "(func) (import \"\" \"\" (memory 0))")
  "import after function"
)
(assert_malformed
  (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (func))")
  "import after global"
)
(assert_malformed
  (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (global f32))")
  "import after global"
)
(assert_malformed
  (module quote
    "(global i64 (i64.const 0)) (import \"\" \"\" (table 0 anyfunc))"
  )
  "import after global"
)
(assert_malformed
  (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (memory 0))")
  "import after global"
)
(assert_malformed
  (module quote "(table 0 anyfunc) (import \"\" \"\" (func))")
  "import after table"
)
(assert_malformed
  (module quote "(table 0 anyfunc) (import \"\" \"\" (global i32))")
  "import after table"
)
(assert_malformed
  (module quote "(table 0 anyfunc) (import \"\" \"\" (table 0 anyfunc))")
  "import after table"
)
(assert_malformed
  (module quote "(table 0 anyfunc) (import \"\" \"\" (memory 0))")
  "import after table"
)
(assert_malformed
  (module quote "(memory 0) (import \"\" \"\" (func))")
  "import after memory"
)
(assert_malformed
  (module quote "(memory 0) (import \"\" \"\" (global i32))")
  "import after memory"
)
(assert_malformed
  (module quote "(memory 0) (import \"\" \"\" (table 1 3 anyfunc))")
  "import after memory"
)
(assert_malformed
  (module quote "(memory 0) (import \"\" \"\" (memory 1 2))")
  "import after memory"
)
(assert_unlinkable
  (module binary
    "\00\61\73\6d\01\00\00\00\01\a9\80\80\80\00\0a\60"
    "\00\00\60\01\7f\00\60\02\7f\7f\00\60\01\7e\00\60"
    "\01\7d\00\60\01\7c\00\60\00\01\7f\60\00\01\7e\60"
    "\00\01\7d\60\00\01\7c\02\e8\82\80\80\00\10\08\6e"
    "\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c\6f\61\64"
    "\65\64\00\00\08\6e\6f\74\20\77\61\73\6d\0a\6f\76"
    "\65\72\6c\6f\61\64\65\64\00\01\08\6e\6f\74\20\77"
    "\61\73\6d\0a\6f\76\65\72\6c\6f\61\64\65\64\00\02"
    "\08\6e\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c\6f"
    "\61\64\65\64\00\03\08\6e\6f\74\20\77\61\73\6d\0a"
    "\6f\76\65\72\6c\6f\61\64\65\64\00\04\08\6e\6f\74"
    "\20\77\61\73\6d\0a\6f\76\65\72\6c\6f\61\64\65\64"
    "\00\05\08\6e\6f\74\20\77\61\73\6d\0a\6f\76\65\72"
    "\6c\6f\61\64\65\64\00\06\08\6e\6f\74\20\77\61\73"
    "\6d\0a\6f\76\65\72\6c\6f\61\64\65\64\00\07\08\6e"
    "\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c\6f\61\64"
    "\65\64\00\08\08\6e\6f\74\20\77\61\73\6d\0a\6f\76"
    "\65\72\6c\6f\61\64\65\64\00\09\08\6e\6f\74\20\77"
    "\61\73\6d\0a\6f\76\65\72\6c\6f\61\64\65\64\03\7f"
    "\00\08\6e\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c"
    "\6f\61\64\65\64\03\7e\00\08\6e\6f\74\20\77\61\73"
    "\6d\0a\6f\76\65\72\6c\6f\61\64\65\64\03\7d\00\08"
    "\6e\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c\6f\61"
    "\64\65\64\03\7c\00\08\6e\6f\74\20\77\61\73\6d\0a"
    "\6f\76\65\72\6c\6f\61\64\65\64\01\70\00\00\08\6e"
    "\6f\74\20\77\61\73\6d\0a\6f\76\65\72\6c\6f\61\64"
    "\65\64\02\00\00"
  )
  "unknown import"
)
